package com.totoro.tygeneratedragonblock.enums;

import com.totoro.tygeneratedragonblock.executor.drop.DropExecutor;
import com.totoro.tygeneratedragonblock.executor.drop.impl.MythicMobsDropExecutor;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Totoro
 * @version 0.1.0
 * @date 2025/8/10 - 23:10
 * @description 掉落执行器枚举
 **/
@AllArgsConstructor
@Getter
public enum DropExecutorEnum {

    MYTHIC_MOBS_DROP("mm", new MythicMobsDropExecutor());

    private final String itemLibrary;
    private final DropExecutor dropExecutor;

    public static DropExecutorEnum getDropExecutorEnum(String drop) {
        for (DropExecutorEnum value : DropExecutorEnum.values()) {
            if(drop.startsWith(value.getItemLibrary())) {
                return value;
            }
        }
        return null;
    }

}
